<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>根据平均分来划分等级</title>
    <script>
        function calculateGrade() {
            var chinese = parseFloat(prompt("请输入语文成绩:"));
            var math = parseFloat(prompt("请输入数学成绩:"));
            var english = parseFloat(prompt("请输入英语成绩:"));
            var chemistry = parseFloat(prompt("请输入化学成绩:"));
            var history = parseFloat(prompt("请输入历史成绩:"));
        
            var total = chinese + math + english + chemistry + history;
            var average = total / 5;
        
            var grade = "";
            if (average >= 90) {
                grade = "优秀";
            } else if (average >= 80) {
                grade = "良好";
            } else if (average >= 70) {
                grade = "中等";
            } else if (average >= 60) {
                grade = "及格";
            } else {
                grade = "不及格";
            }
        
            alert("您的平均分是: " + average.toFixed(2) + "，等级为: " + grade);
        }
        </script>
</head>
<body>
    <button onclick="calculateGrade()">计算平均分和等级</button>
</body>
</html>